package com.onLineCar.vehicle.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.onLineCar.vehicle.entity.TblOrder;
import com.onLineCar.vehicle.entity.request.RequestUpdate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author Xinke_Li
 * @since 2023-12-11
 */
@Mapper
@Repository
//@Qualifier("ds0")
public interface TblOrderMapper extends BaseMapper<TblOrder> {

    @Update("update tbl_order set status = #{driverStatus} where order_number = #{orderNumber}")
    void updateOrderStateByOrderNumber(RequestUpdate requestUpdate);

    /**
     * 查询第一个订单表
     */
    TblOrder selectFiveOne(@Param("driverId") Integer driverId, @Param("orderCode") Integer orderCode);

    @Select("select * from tbl_order where driver_id =#{driverId}")
    List<TblOrder> selectOrderByDriverId(Integer driverId);

}
